package com.example.android.thread.init;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.example.androidthread.R;

public class RunnableActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_thread);

        MyRunnable myRunnable = new MyRunnable();
        Thread t1 = new Thread(myRunnable);
        t1.start();
        for (int i = 0; i < 1000; i++) {
            System.out.println("main:" + i);
        }

    }

    static class MyRunnable implements Runnable{

        @Override
        public void run() {
            for (int i = 0; i < 1000; i++) {
                System.out.println("MyRunnable:" + i);
            }

        }
    }

}
